package com.zhyl.demo.service.impl;

import com.zhyl.demo.entity.BackConsultations;
import com.zhyl.demo.mapper.BackConsultationsMapper;
import com.zhyl.demo.service.BackConsultationsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

@Service
public class BackConsultationsServiceImpl implements BackConsultationsService {
  private final BackConsultationsMapper backConsultationsMapper;
  @Autowired
  private BackConsultationsServiceImpl(BackConsultationsMapper backConsultationsMapper) {
    this.backConsultationsMapper = backConsultationsMapper;
  }

  @Override
  public Boolean saveConsultation(BackConsultations backConsultations) {
    Integer i = backConsultationsMapper.saveConsultation(backConsultations);
    if (i>=0){
      return true;
    }else {
      return false;
    }
  }

    @Override
    public ArrayList<BackConsultations> getSaveConsultation(int appointmentId) {
    if (appointmentId<=0){
      return null;
    }
        return backConsultationsMapper.getSaveConsultation(appointmentId);
    }
}
